package com.supply.supplymanage.controller;

import com.github.pagehelper.PageInfo;
import com.supply.supplymanage.biz.EntrepotBiz;
import com.supply.supplymanage.entity.Entrepot;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/entrepot")
public class EntrepotController {
    @Resource
    private EntrepotBiz entrepotBiz;
    //分页查询
    @RequestMapping("/queryentrepot/{pageNum}")
    @ResponseBody
    public PageInfo queryentrepot(@PathVariable("pageNum") int pageNum){
        System.out.println(pageNum);
        PageInfo pageInfo = entrepotBiz.queryentrepot(pageNum);
        System.out.println(pageInfo);
        return pageInfo;
    }
    //添加
    @RequestMapping("/addentrepot")
    @ResponseBody
    public Entrepot addentrepot(Entrepot entrepot){
        entrepotBiz.addentrepot(entrepot);
        System.out.println(entrepot);
        return entrepot;
    }
}

